#include <iostream>
#include <memory>
#include "udpsever.hpp"

// 用来测试的
std::string test1(const std::string &msg)
{
    std::string hello = "测试接口, ";
    hello += msg;
    return hello;
}

int main(int argc, char *argv[]){
    if(argc!=2){
        std::cerr<<"格式错误  正确格式:"<<"./udpclient server_ip server_port"<<std::endl;
        return 1;
    }
    std::string ip = argv[0];
    uint16_t port = std::stoi(argv[1]);

    Enable_Console_Log_Strategy();

    std::unique_ptr<UdpSever> usvr = std::make_unique<UdpSever>(port,test1);
    usvr->Init();
    usvr->Start();
    return 0;
}